package com.slliver.stock.controller;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/stock")
public class StockController {


    @Value("${server.port}")
    private String port;

    @GetMapping("/test")
    public String test() {
        System.out.println("库存服务调用success...");
        return "库存服务【" + port + "】被调用...";
    }

    @GetMapping("/get/{id}")
    public String get(@PathVariable("id") String id) {
        System.out.println("库存服务调用success...");
        return "库存服务【" + port + "】被调用, 调用的 id是 ==>> " + id;
    }

}
